package com.publishproject;

import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
import android.util.Log;

import com.android_base.core.fragments.XRBaseWebviewFragment;
import com.android_base.core.fragments.XRCommonListFragment;
import com.android_base.core.fragments.XRCommonRefreshFragment;
import com.android_base.core.interfaces.Callback;
import com.android_base.core.module.BaseListDataModule;

import java.util.Arrays;
import java.util.List;

/**
 * Created by tanghongbin on 2017/9/4.
 */

public class ListModule implements BaseListDataModule {
    int count;
    private List<String> demoLists = Arrays.asList(
            "wheelview",
            "switchbutton",
            "gridPasswordView",
            "galleryimagesutil",
            "customsearchview",
            "MaterialCalendarView",
            "testActivity",
            "city_select",
            "looppicview",
            "bindingListView",
            "basepop",
            "recycleview",
            "侧滑菜单",
            "galleryimagesutil",
            "customsearchview",
            "MaterialCalendarView",
            "testActivity",
            "city_select",
            "looppicview",
            "bindingListView",
            "basepop",
            "recycleview",
            "侧滑菜单"
    );

    @Override
    public void loadDataList(Bundle bundle, int pageNo, final Callback<List> callback) {
        Handler handler = new Handler();
        handler.postDelayed(new Runnable() {
            @Override
            public void run() {
                count++;
                Log.i("TAG", "count==" + count);
                if (count < 5) {
                    callback.onSuccess(demoLists);
                } else {
                    callback.onSuccess(null);
                }
            }
        }, 0);
    }
}
